﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Matrix.ViewModel;

namespace Matrix.GUI
{
   /// <summary>
   /// Interaction logic for MathControl.xaml
   /// </summary>
   public partial class MathControl : UserControl
   {
      public MathControl()
      {
         InitializeComponent();
      }

      private void btnUp_Click(object sender, RoutedEventArgs e)
      {
         MatrixManager manager = this.DataContext as MatrixManager;
         if (manager != null)
         {
            manager.PreviousOperation();
         }

      }

      private void btnDown_Click(object sender, RoutedEventArgs e)
      {
         MatrixManager manager = this.DataContext as MatrixManager;
         if (manager != null)
         {
            manager.NextOperation();
         }
      }

      private void Button_Click(object sender, RoutedEventArgs e)
      {
         MatrixManager manager = this.DataContext as MatrixManager;

         if (manager != null)
         {
            manager.SelectedOperation.Process();
         }
      }
   }
}
